package
{
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.geom.Point;
	import flash.text.TextField;

	public class BubbleSprite extends Sprite
	{
		public function BubbleSprite()
		{
			super();
		}
		
		public var color:uint;
		public var radius:int = 20;
		
		public function redraw():void {
			var g:Graphics = this.graphics;
			g.clear();
			g.beginFill(color,1);
			g.drawCircle(0,0,radius);
			g.endFill();
		}
		
		public var position:Point;
		
		public function addLabel(value:String):void {
			var textField:TextField = new TextField();
			textField.text = value;
			textField.width = 40;
			textField.height = 40;
			textField.selectable = false;
			textField.x = (this.width - textField.width) / 2;
			textField.y = (this.height - textField.height) / 2;
			this.addChild(textField);
		}
	}
}